<?php
$this->headTitle('Software Design Description for ' . $this->projectName);
?>

<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>/js/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>/js/jquery/jquery.jeditable-1.6.0.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl(); ?>/js/bpm/bpm.jquery.tinymce-editable.js"></script>

<script type="text/javascript">
function addSignature(section) {
	$.ajax({
		data:   {
			name:		$('#newSig').val(),
			'section':	section
		},
		dataType:   'json',
		success:    function(rsp, status) {
			loadSignatures('sdd');
			$('#newSig').val("");
		},
		type:       'POST',
		url:        '<?php echo $this->baseUrl(); ?>/signatures/add/'
	});
}

function loadSignatures(section) {
	$('#signatures').load('<?php echo $this->baseUrl(); ?>/signatures/generate/type/2');
}

$(document).ready(function() {
	loadSignatures('Software Design');

	$('#designOverview').editable('<?php echo $this->baseUrl(); ?>/sdd/save/section/designOverview/', {
		type:		'mce',
		submit:		'Save',
		cancel:		'Cancel',
		indicator:	'Saving...',
		tooltip:	'Click to Edit...',
		width:		'500px',
		height:		'300px'
	});

	$('#chosenArchitecture').editable('<?php echo $this->baseUrl(); ?>/sdd/save/section/chosenArchitecture/', {
		type:		'mce',
		submit:		'Save',
		cancel:		'Cancel',
		indicator:	'Saving...',
		tooltip:	'Click to Edit...',
		width:		'500px',
		height:		'300px'
	});

	$('#alternateDesigns').editable('<?php echo $this->baseUrl(); ?>/sdd/save/section/alternateDesigns/', {
		type:		'mce',
		submit:		'Save',
		cancel:		'Cancel',
		indicator:	'Saving...',
		tooltip:	'Click to Edit...',
		width:		'500px',
		height:		'300px'
	});

	$('#systemInterfaceDescription').editable('<?php echo $this->baseUrl(); ?>/sdd/save/section/systemInterfaceDescription/', {
		type:		'mce',
		submit:		'Save',
		cancel:		'Cancel',
		indicator:	'Saving...',
		tooltip:	'Click to Edit...',
		width:		'500px',
		height:		'300px'
	});

	$('#componentDescription').editable('<?php echo $this->baseUrl(); ?>/sdd/save/section/componentDescription/', {
		type:		'mce',
		submit:		'Save',
		cancel:		'Cancel',
		indicator:	'Saving...',
		tooltip:	'Click to Edit...',
		width:		'500px',
		height:		'300px'
	});

	$('#userInterfaceDescription').editable('<?php echo $this->baseUrl(); ?>/sdd/save/section/userInterfaceDescription/', {
		type:		'mce',
		submit:		'Save',
		cancel:		'Cancel',
		indicator:	'Saving...',
		tooltip:	'Click to Edit...',
		width:		'500px',
		height:		'300px'
	});

	$('#additionalMaterial').editable('<?php echo $this->baseUrl(); ?>/sdd/save/section/additionalMaterial/', {
		type:		'mce',
		submit:		'Save',
		cancel:		'Cancel',
		indicator:	'Saving...',
		tooltip:	'Click to Edit...',
		width:		'500px',
		height:		'300px'
	});
});
</script>

<h1>Software Design Description for '<?php echo $this->projectName; ?>'</h1>

<h2>1. Introduction</h2>
	<blockquote>
		<h3>1. Design Overview</h3>
		<blockquote>
			<div id="designOverview">
				<?php echo ($this->designOverview == '' ? 'No Text Supplied' : $this->designOverview); ?>
			</div>
		</blockquote>
	</blockquote>

<h2>2. System Architecture Design</h2>
	<blockquote>
		<h3>1. Chosen System Architecture</h3>
		<blockquote>
			<div id="chosenArchitecture">
				<?php echo ($this->chosenArchitecture == '' ? 'No Text Supplied' : $this->chosenArchitecture); ?>
			</div>
		</blockquote>

		<h3>2. Discussion of Alternate Designs</h3>
		<blockquote>
			<div id="alternateDesigns">
				<?php echo ($this->alternateDesigns == '' ? 'No Text Supplied' : $this->alternateDesigns); ?>
			</div>
		</blockquote>

		<h3>3. System Interface Description</h3>
		<blockquote>
			<div id="systemInterfaceDescription">
				<?php echo ($this->systemInterfaceDescription == '' ? 'No Text Supplied' : $this->systemInterfaceDescription); ?>
			</div>
		</blockquote>
	</blockquote>

<h2>3. Detailed Description of Components</h2>
	<blockquote>
		<div id="componentDescription">
			<?php echo ($this->componentDescription == '' ? 'No Text Supplied' : $this->componentDescription); ?>
		</div>
	</blockquote>

<h2>4. User Interface Design</h2>
	<blockquote>
		<h3>1. Description of User Interface</h3>
		<div id="userInterfaceDescription">
			<?php echo ($this->userInterfaceDescription == '' ? 'No Text Supplied' : $this->userInterfaceDescription); ?>
		</div>
	</blockquote>

<h2>5. Additional Material</h2>
	<blockquote>
		<div id="additionalMaterial">
			<?php echo ($this->additionalMaterial == '' ? 'No Text Supplied' : $this->additionalMaterial); ?>
		</div>
	</blockquote>


<h2>Signatures</h2>
<div id="signatures">
</div>

<div id="addSig">
<label for="newSig">Name:</label><input type="text" name="newSig" id="newSig">
<button onClick="addSignature('Software Design');">Add Signature</button>
</div>

